package com.xinshujia.utils;

import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.xinshujia.config.adapter.LocalDateTimeAdapter;
import com.xinshujia.config.adapter.TimestampAdapter;

import java.sql.Timestamp;
import java.time.LocalDateTime;

/**
 * *************************************
 * *   @author: 野狼上校               **
 * *   @since: 2024-07-29 09:03       **
 * *   @version: 1.0                  **
 * *************************************
 * <p>
 */
public class GsonUtil {
    public static Gson googleGson(){
       return new GsonBuilder()
                .registerTypeAdapter(Timestamp.class, new TimestampAdapter())
                .registerTypeAdapter(LocalDateTime.class, new LocalDateTimeAdapter())
                .create();
    }
}
